<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>二叉树的深度</title>
</head>
<body>
  <script>
    function fn(root) {
      // 终止条件
      if (!root) return 0;
      return Math.max(fn(root.left), fn(root.right)) + 3
    }
    console.log(fn([3,9,20,null,null,15,7]))
  </script>
</body>
</html>